package com.finance.action.android.customer;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.common.vo.JsonVo;
import com.finance.entity.customer.AccountExec;
import com.finance.service.customer.AccountExecService;

@Controller("AccountExecAction")
public class AccountExecAction {
	
	@Resource(name = "AccountExecService")
	private AccountExecService accountExecService;
	
	/**
	 * 添加授权账号
	 * @param kfUserId 客户id
	 * @param accountNumber 账号
	 * @param accountPassword 账号密码
	 * @param type 类型（如 1淘宝 2京东  3运营商）
	 * @return
	 */
	@ResponseBody
	@RequestMapping("addaccountexec")
	public JsonVo<String> addaccountexec(String kfUserId,String accountNumber,String accountPassword,Integer type){
		JsonVo<String> json = new JsonVo<String>();
		AccountExec accountExec = new AccountExec();
		accountExec.setKfUserId(kfUserId);
		accountExec.setAccountNumber(accountNumber);
		accountExec.setAccountPassword(accountPassword);
		accountExec.setType(type);
		accountExec.setCreationTime(new Date());
		accountExecService.insert(accountExec);
		json.setCode(200);
		json.setMsg("成功");
		json.setSuccess(true);
		return json;
	}

}
